<?php

require_once('lex_pattern_lexer.php');
require_once('lex_pattern_parser.php');
require_once('../lexical_pattern.php');
require_once('scaners.php');

$scanner = new lex_pattern_lexer(fopen("scaner_test.input", "r"));

$parser = new lex_pattern_yyParser();

while ($token = $scanner->next_token()) {
    $parser->doParse($token->type(), $token->value());
}
$parser->doParse(0);
//var_dump($parser->list);

$common_scaner = new block_formal_langs_scaner($parser->list, $parser->conditions);
//var_dump($common_scaner);

$common_scaner->print_dot("scaner.dot");
$r = $common_scaner->tokenize("a b c + * ( ) q234 abc q a w bbbbb cccccc", false);
var_dump($r);
?>
